<template>
  <div class="upload-cmp">
    <input type="file" v-show="false" id="uploadFile" @change="uploadFile">
    <label for="uploadFile">
      <slot></slot>
    </label>
  </div>
</template>

<script>
export default {
  name: 'upload-cmp',
  methods: {
    uploadFile (e) {
      let file = e.target.files[0];
      this.$emit('uploadFile', file)
      e.target.value = ''
    },
  }
}
</script>

<style scoped>
</style>